﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" >

    <ResourceDictionary.MergedDictionaries>
    	<ResourceDictionary Source="OMANE_Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
   
   <LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
		<GradientStop Color="#ABADB3" Offset="0.05"/>
		<GradientStop Color="#E2E3EA" Offset="0.07"/>
		<GradientStop Color="#E3E9EF" Offset="1"/>
	</LinearGradientBrush>
    
    <Style TargetType="{x:Type Control}" x:Key="controlOMANE">
        <Setter Property="FontFamily" Value="Calibri" />
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="FontWeight" Value="Bold"/>
    </Style>
    
    <Style TargetType="{x:Type TextBlock}" x:Key="TextBlockOMANE">
        <Setter Property="FontFamily" Value="Calibri" />
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="FontWeight" Value="Bold"/>    
    </Style>

    <Style x:Key="OMANE_labelTitre" TargetType="{x:Type Label}" BasedOn="{StaticResource controlOMANE}">
        <Setter Property="Height" Value="27" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Label}">
                    <Border
                        x:Name="BorderExt"
                        CornerRadius="0"
                        BorderThickness="1,1,1,1"
                        Background="White"
                        BorderBrush="{StaticResource BrushCouleur1Base}">
                        <Border
                            x:Name="BorderInt"
                            Margin="1,1,0,0"
                            CornerRadius="0"
                            BorderThickness="0"
                            Background="{StaticResource DegradeBckTitre}">
                            <ContentPresenter Margin="2" HorizontalAlignment="Center" 
                                              VerticalAlignment="Center" 
                                              RecognizesAccessKey="True"/>
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
	<Style x:Key="CustomTextBoxStyle" BasedOn="{StaticResource controlOMANE}" TargetType="{x:Type TextBox}">
		<Style.Resources>
		
		</Style.Resources>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource DefaultBackgroundBrush}"/>
		<Setter Property="BorderBrush" Value="{DynamicResource BrushCouleur2Base}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="IsUndoEnabled" Value="True"/>
		<Setter Property="AllowDrop" Value="False"/>
		<Setter Property="Cursor" Value="Pen"/>
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <DockPanel LastChildFill="True">
                        <TextBlock DockPanel.Dock="Right" 
                        Foreground="Orange"
                        FontSize="12pt">
                        !!!!
                        </TextBlock>
                        
                            <AdornedElementPlaceholder />
                       
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
         </Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" CornerRadius="5">
						<StackPanel Orientation="Vertical">
							<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Visibility="Collapsed" />
							<TextBlock x:Name="textBlock" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="{TemplateBinding Text}" Width="Auto" Visibility="Visible" Margin="1"/>
						</StackPanel>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsFocused" Value="True">
							<Setter Property="Visibility" TargetName="PART_ContentHost" Value="Visible"/>
							<Setter Property="Visibility" TargetName="textBlock" Value="Collapsed"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
                        
                    </ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Width" Value="150"/>
		<Setter Property="HorizontalAlignment" Value="Left"/>
		<Setter Property="Margin" Value="5,0,0,0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="ToolTip"
             Value="{Binding RelativeSource={x:Static RelativeSource.Self},
              Path=(Validation.Errors)[0].ErrorContent}"></Setter>
                <Setter Property="Background" Value="Red"></Setter>
            </Trigger>

            <Trigger Property="IsFocused" Value="True">
				<Setter Property="BorderBrush" Value="#FFB700FF"/>
				<Setter Property="Background" Value="White"/>
				<Setter Property="Text" Value=""/>
			</Trigger>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="RenderTransform">
					<Setter.Value>
						<TransformGroup>
							<ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>		
	</Style>
	<Style x:Key="PercentageCustomTextBoxStyle" BasedOn="{StaticResource CustomTextBoxStyle}" TargetType="{x:Type TextBox}">
		<Setter Property="Template">
		<Setter.Value>
			<ControlTemplate TargetType="{x:Type TextBox}">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="*"/>
					</Grid.ColumnDefinitions>
					<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" CornerRadius="5" d:LayoutOverrides="Height" Grid.ColumnSpan="2">
						<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
					<GridSplitter HorizontalAlignment="Left" Grid.Column="1" Width="2" Background="{DynamicResource BrushCouleur1Base}" />
				</Grid>
				<ControlTemplate.Triggers>
					<Trigger Property="IsEnabled" Value="false">
						<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
					</Trigger>
				</ControlTemplate.Triggers>
			</ControlTemplate>
		</Setter.Value>
	</Setter>
		<Setter Property="Background">
			<Setter.Value>
				<LinearGradientBrush EndPoint="0,0" StartPoint="1,0">
					<GradientStop Color="#FFE2EAF3" Offset="0"/>
					<GradientStop Color="#FFC3CEDC" Offset="0.5"/>
					<GradientStop Color="#FFA2B1C4" Offset="0.5"/>
					<GradientStop Color="#FFB4C3DB" Offset="1"/>
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
